class LocationIp {
  getAddress(callback) {
    $tool.loadScript('https://pv.sohu.com/cityjson', function (rs) {
      if (returnCitySN) {
        let cname = returnCitySN.cname
        let a = cname.indexOf('省')
        let city = null
        if (a != -1) {
          city = cname.substring(a + 1)
        } else {
          // 直辖市
          let b = cname.indexOf('市')
          if (b != -1) {
            city = cname.substring(0, b)
          } else {
            city = cname
          }
        }
        callback({city})
      } else {
        callback({code: -101, msg: '无法获取当前城市定位'})
      }
    }, 'ip_city')
  }
}
export default LocationIp
